package web;

import java.io.IOException;

import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ViewManager extends HttpServlet implements Servlet {
	private static final long serialVersionUID = 1L;
	private String nextPage;

	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		String command = request.getParameter(Const.COMMAND);
		System.out.println("View");
		if (command.equals(Const.REPORT)) {
			nextPage = "/report.jsp";
		} else if (command.equals(Const.DEPOSIT)) {
			nextPage = "/deposit.jsp";
			
		}
		getServletContext().getRequestDispatcher(nextPage).forward(request,
				response);

	}
}
